package com.yifan.Thread;

/**
 * @Author YIFan
 * @Date 2020/6/6 12:15
 * @Version 1.0
 */
public class ThreadJoin implements  Runnable{

    public static void main(String[] args) throws InterruptedException {

        System.out.println("main start  ........");

        ThreadJoin threadJoin = new ThreadJoin();
        Thread t1 = new Thread(threadJoin);
        Thread t2 = new Thread(threadJoin);

        t1.start();
        t1.join();

        t2.start();
//        t2.join();

        System.out.println("main end  ........");

    }

    public  void run() {
        for (int i = 0; i < 100; i++) {
            System.err.println(Thread.currentThread().getName()+"线程 VIP -->"+ i);
        }
    }
}
